using System;
using System.Text;

namespace RealState.BusinessObjects
{
	[Serializable()]
	public class Users
	{
        private int _RowNum;

        public int RowNum
        {
            get { return _RowNum; }
            set { _RowNum = value; }
        }

		private int _Id;

		public int Id
		{
			get { return _Id; }
			set { _Id = value; }
		}

		private string _UserName;

		public string UserName
		{
			get { return _UserName; }
			set { _UserName = value; }
		}

		private string _Password;

		public string Password
		{
			get { return _Password; }
			set { _Password = value; }
		}

		private string _FullName;

		public string FullName
		{
			get { return _FullName; }
			set { _FullName = value; }
		}

		private string _Tel;

		public string Tel
		{
			get { return _Tel; }
			set { _Tel = value; }
		}

		private string _Mobile;

		public string Mobile
		{
			get { return _Mobile; }
			set { _Mobile = value; }
		}

		private string _Address;

		public string Address
		{
			get { return _Address; }
			set { _Address = value; }
		}

		private Nullable<int> _UserType;

		public Nullable<int> UserType
		{
			get { return _UserType; }
			set { _UserType = value; }
		}

		public Users()
		{ }

		public Users(int Id,string UserName,string Password,string FullName,string Tel,string Mobile,string Address,Nullable<int> UserType)
		{
			this.Id = Id;
			this.UserName = UserName;
			this.Password = Password;
			this.FullName = FullName;
			this.Tel = Tel;
			this.Mobile = Mobile;
			this.Address = Address;
			this.UserType = UserType;
		}

		public override string ToString()
		{
			return "Id = " + Id.ToString() + ",UserName = " + UserName + ",Password = " + Password + ",FullName = " + FullName + ",Tel = " + Tel + ",Mobile = " + Mobile + ",Address = " + Address + ",UserType = " + UserType.ToString();
		}

		public class IdComparer : System.Collections.Generic.IComparer<Users>
		{
			public SorterMode SorterMode;
			public IdComparer()
			{ }
			public IdComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Users> Membres
			int System.Collections.Generic.IComparer<Users>.Compare(Users x, Users y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Id.CompareTo(x.Id);
				}
				else
				{
					return x.Id.CompareTo(y.Id);
				}
			}
			#endregion
		}
		public class UserNameComparer : System.Collections.Generic.IComparer<Users>
		{
			public SorterMode SorterMode;
			public UserNameComparer()
			{ }
			public UserNameComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Users> Membres
			int System.Collections.Generic.IComparer<Users>.Compare(Users x, Users y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.UserName.CompareTo(x.UserName);
				}
				else
				{
					return x.UserName.CompareTo(y.UserName);
				}
			}
			#endregion
		}
		public class PasswordComparer : System.Collections.Generic.IComparer<Users>
		{
			public SorterMode SorterMode;
			public PasswordComparer()
			{ }
			public PasswordComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Users> Membres
			int System.Collections.Generic.IComparer<Users>.Compare(Users x, Users y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Password.CompareTo(x.Password);
				}
				else
				{
					return x.Password.CompareTo(y.Password);
				}
			}
			#endregion
		}
		public class FullNameComparer : System.Collections.Generic.IComparer<Users>
		{
			public SorterMode SorterMode;
			public FullNameComparer()
			{ }
			public FullNameComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Users> Membres
			int System.Collections.Generic.IComparer<Users>.Compare(Users x, Users y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.FullName.CompareTo(x.FullName);
				}
				else
				{
					return x.FullName.CompareTo(y.FullName);
				}
			}
			#endregion
		}
		public class TelComparer : System.Collections.Generic.IComparer<Users>
		{
			public SorterMode SorterMode;
			public TelComparer()
			{ }
			public TelComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Users> Membres
			int System.Collections.Generic.IComparer<Users>.Compare(Users x, Users y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Tel.CompareTo(x.Tel);
				}
				else
				{
					return x.Tel.CompareTo(y.Tel);
				}
			}
			#endregion
		}
		public class MobileComparer : System.Collections.Generic.IComparer<Users>
		{
			public SorterMode SorterMode;
			public MobileComparer()
			{ }
			public MobileComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Users> Membres
			int System.Collections.Generic.IComparer<Users>.Compare(Users x, Users y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Mobile.CompareTo(x.Mobile);
				}
				else
				{
					return x.Mobile.CompareTo(y.Mobile);
				}
			}
			#endregion
		}
		public class AddressComparer : System.Collections.Generic.IComparer<Users>
		{
			public SorterMode SorterMode;
			public AddressComparer()
			{ }
			public AddressComparer(SorterMode SorterMode)
			{
				this.SorterMode = SorterMode;
			}
			#region IComparer<Users> Membres
			int System.Collections.Generic.IComparer<Users>.Compare(Users x, Users y)
			{
				if (SorterMode == SorterMode.Ascending)
				{
					return y.Address.CompareTo(x.Address);
				}
				else
				{
					return x.Address.CompareTo(y.Address);
				}
			}
			#endregion
		}
	}
}
